﻿using System;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;

namespace ChaterFuncLib
{
    public static class Serializer
    {
        public static void Serialize(NetworkStream str, object obj)
        {
            new BinaryFormatter().Serialize(str, obj);
        }

        public static Packet Deserialize(NetworkStream str)
        {
            return (Packet)new BinaryFormatter().Deserialize(str);
        }
    }
}